
<!-- start of content -->
<%@ taglib uri="/tags/struts-bean" prefix="bean" %> 
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %> 
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>

<tiles:importAttribute />
<%
	int outwardBarNumber=0;
	int returnBarNumber=0;
%>

<!-- content -->
<table cellspacing="0" cellpadding="0" border="0">
	<form name="submitform">
	
	<tr>
		
		<td colspan="6" nowrap="nowrap" align="center">
			<img src="pages/images/outward.gif"/>
		</td>
		
		<!--second -->
		
		<td width="0%">
			<img src="pages/images/topLeftCurve.gif"/>
		</td>
		
		<td background="pages/images/headingBody.gif">
			<img src="pages/images/times.gif"/>
		</td>
		
		<td background="pages/images/headingBody.gif">
			<img src="pages/images/prices.gif"/>
		</td>
		
		<td background="pages/images/headingBody.gif" width="50%">
			<img src="pages/images/barChart.gif"/>
		</td>
		
		<td width="0%">
			<img src="pages/images/bottomRightCurve.gif"/>
		</td>
		<td/>
		
	</tr>

	<tr>
		<td height="5" colspan="12" />
	</tr>
	
	<tr>
<!--first-->
		<td />
		<td width="0%">
			<img src="pages/images/topLeftCurve.gif" />
		</td>

		<td background="pages/images/headingBody.gif">
			<img src="pages/images/times.gif" />
		</td>

		<td background="pages/images/headingBody.gif">
			<img src="pages/images/prices.gif" />
		</td>


		<td background="pages/images/headingBody.gif" width="50%">
			<img src="pages/images/barChart.gif" />
		</td>

		<td width="0%">
			<img src="pages/images/bottomRightCurve.gif" />
		</td>
		
		<!--second -->
	
		<td colspan="6" nowrap="nowrap" align="center" >
			<img src="pages/images/return.gif" />
		</td>
		
	</tr>

	<tr>
		<td height="2" colspan="12" />
		
	</tr>

	<tr>
		<td colspan="12"/>
	</tr>
	
	
	<logic:empty name="dateItems">
		<tr>
			<td colspan="16" nowrap="nowrap" align="center">
				<br/>
				<br/>
				<br/>
				<br/>
				<br/>
				
				<div class="sorry">sorry<font color="#FFDE00">,</font></div>
				
				<div class="sorryText">There is no ticket information availble
					that matches your search.
					<br/>Please try an earlier date or an alternitive ticket type. </div>
			</td>
		</tr>
	</logic:empty>
	
	<%
		int dayNumber = 0;
	%>
	
	<logic:iterate id="dateItem" name="dateItems"
		type="com.trainfinder.database.DateItem" indexId="i">
	
		<bean:define id="isSaturday" name="dateItem" property="isSaturday" />
		
		<%
			dayNumber++;
		%>
		
		<div id="ret<%=++returnBarNumber%>"
						isSaturday="<%=isSaturday%>" isNotice="true"
						dayNumber="<%=dayNumber%>" width="0" height="0"/>
			
		<div id="out<%=++outwardBarNumber%>"
						isSaturday="<%=isSaturday%>" isNotice="true"
						dayNumber="<%=dayNumber%>" width="0" height="0"/>
		
		<!-- Date line -->
		<tr>
			<td colspan="12" nowrap="nowrap" width="100%"
				valign="bottom" height="0%">
				<table cellspacing="0" cellpadding="0">
					<tr>
						<td nowrap="nowrap" valign="bottom" width="50%"
							height="0%">
							<table cellspacing="0" cellpadding="0">
								<tr>
									<td>
										<div><img src="pages/images/leftFrame.gif" /></div>
									</td>

									<td width="100%"
										background="pages/images/horizontalLine.gif" />
								</tr>
							</table>

						</td>
<!--date -->
						<td nowrap="nowrap">
		
							<div class="date">&nbsp;
								<bean:write name="dateItem" property="date" />&nbsp;
							</div>
							
						</td>

						<td nowrap="nowrap" width="50%">
							<table cellspacing="0" cellpadding="0">
								<tr>

									<td width="100%"
										background="pages/images/horizontalLine.gif" />

									<td>
										<div><img src="pages/images/rightFrame.gif" /></div>
									</td>
								</tr>
							</table>

						</td>

					</tr>
				</table>
			</td>
			
			
		</tr>

		<bean:define id="lines" name="dateItem" property="lines" />
		<% 
			boolean hasOutward = false;
			boolean hasReturn = false;
		%>
	 
		<logic:iterate id="line" name="lines" type="com.trainfinder.database.Line">
			 
							
			<tr>	
			<!-- vertical bar -->
		<td width="0%" bgcolor="#c0c0c0" />
		<img src="pages/images/verticalFrame.gif" />
		</td>

		<td />

	
		<logic:present name="line" property="outwardJourney">
			<bean:define id="outwardJourney" name="line" property="outwardJourney"/>
		
				<!-- time -->
				<td nowrap="nowrap">
					<div class="time"><bean:write name="outwardJourney" property="time" />
					&nbsp;</div>
				</td>
				
				<bean:define id="text" name="outwardJourney" property="text" />
							
				<bean:define id="width"
									name="outwardJourney" property="percentageOfMaxPrice" />	
				<bean:define id="date"
									name="outwardJourney" property="travelDetailsDate" />
				<bean:define id="time"
									name="outwardJourney" property="travelDetailsTime" />
				<bean:define id="city"
									name="outwardJourney" property="departureCityCode" />
				<bean:define id="weekdayPrice"
									name="outwardJourney" property="weekdayPrice" />
				<bean:define id="hour"
									name="outwardJourney" property="hour" />
				 
				<!-- price -->
				 
				<td nowrap="nowrap">
						<div class="price" >
						<a alt="<%=text%>" title="<%=text%>"> 
							&#163;
							<bean:write name="outwardJourney" property="weekdayPrice" />&nbsp;
						</a></div>
						
				</td>
		
			
			<!-- bar chart-->
				<td colspan="2" nowrap="nowrap">
					
					<table width="100%" height="0%" cellspacing="0" cellpadding="0">
						<tr>
								
							<td width="0%" valign="middle">
								<input type="radio" onClick="radioSelectionOutward('out<%=++outwardBarNumber%>','<%=date%>','<%=time%>','<%=city%>','<%=weekdayPrice%>')" name="outward" id="radioOutward<%=outwardBarNumber%>"/>
							</td>
									
							<!-- #ffea42 -->
							<td  width="<%=width%>%" valign="middle" >
								<table cellspacing="0" cellpadding="0" border="0"  width="100%" valign="bottom">
									<tr valign="middle">
										<td valign="bottom" width="<%=width%>%" height="9" bgcolor="#ffea42"
											 onMouseOver="mouseOverOutward(this)" 
											 onMouseOut="mouseOutOutward(this)"  
											 onMouseDown="mouseDownOutward(this,'<%=date%>','<%=time%>','<%=city%>','<%=weekdayPrice%>')"						
											 id="out<%=outwardBarNumber%>"
											 isSaturday="<%=isSaturday%>"
											 dayNumber="<%=dayNumber%>"
											 hour="<%=hour%>"
											 index="<%=outwardBarNumber%>"/> 
										
									</tr>
								</table> 
							</td>
							 <td height="10" width="100%"/>	  
						</tr>
					</table>
				</td>
			
			
				<td/>
				
				<% hasOutward = true;%>
			</logic:present>

			<logic:notPresent name="line" property="outwardJourney">
				<% if(!hasOutward) { hasOutward = true; %>
					<td colspan="5">no ticket information available</td>
				<%} else { %>
					<td colspan="5" />
				<%} %>
			</logic:notPresent>
			
					
			<logic:present name="line" property="returnJourney">
				<bean:define id="returnJourney" name="line" property="returnJourney"/>
		
					<!-- time -->
					<td nowrap="nowrap">
						<div class="time"><bean:write name="returnJourney"
							property="time" />
						&nbsp;</div>
					</td>

					<!-- price -->
					<!-- alt text -->
					<td nowrap="nowrap">
					
					<bean:define id="text"
									name="returnJourney" property="text" />
					<bean:define id="date"
									name="returnJourney" property="travelDetailsDate" />
					<bean:define id="time"
									name="returnJourney" property="travelDetailsTime" />
					<bean:define id="city"
									name="returnJourney" property="arrivalCityCode" />
					<bean:define id="hour"
									name="returnJourney" property="hour" />
					<bean:define id="weekdayPrice"
									name="returnJourney" property="weekdayPrice" />
					<div class="price">
						<a alt="<%=text%>" title="<%=text%>"> 
						&#163;
						<bean:write name="returnJourney"
						property="weekdayPrice"/>
						&nbsp;
						</a>
						</area></div>
					</td>
				
					<bean:define id="width"
									name="returnJourney" property="percentageOfMaxPrice" />	
			
		
		<!-- bar chart-->
				<td colspan="2" nowrap="nowrap">
					
					<table width="100%" height="0%" cellspacing="0" cellpadding="0">
						<tr>
								
							<td width="0%" valign="middle">
								<input type="radio" name="return"  onClick="radioSelectionReturn('ret<%=++returnBarNumber%>','<%=date%>','<%=time%>','<%=city%>','<%=weekdayPrice%>')"  id="radioReturn<%=returnBarNumber%>"/>
							</td>
									
							<!-- #ffea42 -->
							<td  width="<%=width%>%" valign="middle">
								<table cellspacing="0" cellpadding="0" border="0"  width="100%" valign="bottom">
									<tr valign="middle">
										<td valign="bottom" width="<%=width%>%" height="9" bgcolor="#ffea42"
											 onMouseOver ="javascript:mouseOverReturn(this);" 
											 onMouseOut ="mouseOutReturn(this);"  
											 onMouseDown="mouseDownReturn(this,'<%=date%>','<%=time%>','<%=city%>','<%=weekdayPrice%>');"
											 id="ret<%=returnBarNumber%>"
											 isSaturday="<%=isSaturday%>"
											 hour="<%=hour%>"
											 dayNumber="<%=dayNumber%>"
											 index="<%=returnBarNumber%>"/> 
													
									</tr>
								</table> 
							</td>
							 <td height="10" width="100%"/>	  
						</tr>
					</table>
				</td>
					
					<% hasReturn = true;%>
		</logic:present>
		
	
		
		<logic:notPresent name="line" property="returnJourney">
				<% if(!hasReturn) { hasReturn = true; %>
					<td colspan="4">no ticket information available</td>
				<%} else { %>
					<td colspan="4" />
				<%} %>
			</logic:notPresent>
		
		
					<!-- vertical bar-->
					<td width="0%" bgcolor="#c0c0c0" />
					<img src="pages/images/verticalFrame.gif" />
					</td>
					
	
	</tr>
				
		
	</logic:iterate>


	<tr>

		<td>
			<img src="pages/images/verticalBottomFrame.gif" />
		</td>
		<td width="100%" colspan="10"
			background="pages/images/horizontalLine.gif" />

		<td>
			<img src="pages/images/verticalBottomFrame.gif" />
		</td>
		
	</tr>
	<tr>
		 
		<td colspan="12"  cellspacing="0" cellpadding="0" border="0">	
			<table >
				<tr>
					<td>
						<a href="#top" style="color:#666666">top</a>
					</td>
					<td width="100%"/>
					<td align="right" id="nextBorder<%=dayNumber%>">
						
							<input type="button" value="book" disabled="true" id="next<%=dayNumber%>"
								onClick="return submitEurostarBooking()"/>
					
					</td>
				</tr>
			</table>
		</td>
	</tr>

	</logic:iterate>

	
	<div id="colcounts" dayNumberCount="<%=dayNumber%>" outwardBarCount="<%=outwardBarNumber%>" returnBarCount="<%=returnBarNumber%>" height="0" width="0"/>
	</form>

</table>
									
<tiles:get name="bookingForm"/>

<!-- end of content -->


